<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>每人一亿 RRC</title>
    <style>
      input {
        width: 90%;
        height: 36px;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        display: block;
        margin-bottom: 10px;
        outline: none;
        padding: 7px 12px;
        box-sizing: border-box;
      }
      button {
        width: 90%;
        border-radius: 6px;
        display: block;
        height: 36px;
        border: none;
      }
      p {
        word-break: break-all;
      }
    </style>
  </head>
  <body>
    <p>每人一亿 RRC，限领一次。</p>
    <p>请先在恒星币钱包中添加资产 RRC，发行方地址：</p>
    <p>GDS5NDSBJNPOFRWSIMBRXVDMZV7AYPCL7Y4CBTSSJ77KH537637UIFDY</p>
    <p>请输入你的公钥地址。 </p>
    <p>请勿填写私钥！！！</p>
    <input id="address" placeholder="公钥地址" />
    <button id="submit">提交</button>
  </body>
  <script>
    const button = document.getElementById("submit");
    let disabled = false;
    button.onclick = () => {
      if (disabled) {
        return;
      }
      button.disabled = true;
      disabled = true;
      const input = document.getElementById("address");
      const url =
        "https://service-5n7a6gfb-1252031367.sh.apigw.tencentcs.com/release/rrc?" +
        input.value;
      fetch({ url });
      alert("一个亿正在发送……若迟迟未收到，请检查地址是否正确、是否授信 RRC，或重试。")
    };
  </script>
</html>
